<?php

namespace App\Models\VoteGroup;

use App\Models\Activity\Activity;
use App\Models\Groupable;
use App\Models\VoteCandidate\VoteCandidate;
use App\Support\Database\Eloquent\UuidModel;

class VoteGroup extends UuidModel
{
    protected $fillable = ['activity_id', 'order_id', 'type', 'title', 'memo'];
    const TYPE_VOTE = 1;
    const TYPE_QUIZ = 2;

    public function voteCandidate()
    {
        return $this->hasMany(VoteCandidate::class, 'group_id', 'id');
    }

    public function activity()
    {
        return $this->belongsTo(Activity::class, 'activity_id', 'id');
    }
}
